package com.lzq.mq.nameserver;

import com.lzq.mq.common.debug.DebugHelper;
import com.lzq.mq.nameserver.common.CommonCache;
import com.lzq.mq.nameserver.core.NameServerStarter;

import java.util.Scanner;

import static com.lzq.mq.common.constants.NameServerConstants.DEFAULT_NAMESERVER_PORT;

public class NameServerStartup {


    public static void main(String[] args) throws InterruptedException {

        CommonCache.init();

        int port = DEFAULT_NAMESERVER_PORT;
        if (DebugHelper.DEBUG) {
            Scanner scanner = new Scanner(System.in);
            System.out.print("请输入端口号：");
            port = scanner.nextInt();
        }
        NameServerStarter nameServer = new NameServerStarter(port);
        nameServer.startServer();
    }
}
